package chapter14;

/**
 * @author : DuJiabao
 * @Date : 2021/2/25 9:26
 * @Project : thinking_in_java
 * @File : null.java
 * @Desc :
 */
class Creature {
}

class Dog0 extends Creature {
  public void bark() {
    System.out.println("汪汪汪");
  }
}


public class instanceofTest {
  public static void main(String[] args) {
    Creature dog = new Dog0();
    if (dog instanceof Dog0) {
      ((Dog0)dog).bark();
    }
  }
}
